package cn.iocoder.yudao.module.trade.controller.app.order.vo;

import cn.iocoder.yudao.framework.common.validation.InEnum;
import cn.iocoder.yudao.framework.common.validation.Mobile;
import cn.iocoder.yudao.module.member.api.config.dto.MemberConfMaterialDTO;
import cn.iocoder.yudao.module.trade.enums.delivery.DeliveryTypeEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.Valid;
import lombok.Data;

import java.math.BigDecimal;

@Schema(description = "用户 App - 交易订单结算 Request VO")
@Data
@Valid
public class AppTradeOrderOrderReqVO {

    // ========== 订单相关字段 ==========
//    @InEnum(value = MetalTypeEnum.class, message = "金属类型不正确")
    private Integer metalType;
//    @InEnum(value = TransactionTypeEnum.class, message = "交易类型不正确")
    private Integer transactionType;
    @Schema(description = "克重", example = "1")
    private BigDecimal weight;
    @Schema(description = "总价", example = "1")
    private BigDecimal price;
    @Schema(description = "下单时价", example = "1")
    private BigDecimal livePrice;
    private BigDecimal deposit;
    private BigDecimal processPrice;
    // ========== 旧料兑换相关字段 ==========

    @Schema(description = "克重", example = "1")
    private BigDecimal exchangeWeight;
    @Schema(description = "克重", example = "1")
    private BigDecimal convertWeight;

    // ========== 配送相关字段 ==========

    private Boolean isStore;
    @Schema(description = "配送方式", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @InEnum(value = DeliveryTypeEnum.class, message = "配送方式不正确")
    private Integer deliveryType;

    @Schema(description = "收件地址编号", example = "1")
    private Long addressId;

    @Schema(description = "自提门店编号", example = "1088")
    private Long pickUpStoreId;
    private Long pickupInfoId;
    @Schema(description = "收件人名称", example = "芋艿") // 选择门店自提时，该字段为联系人名
    private String receiverName;
    @Schema(description = "收件人手机", example = "15601691300") // 选择门店自提时，该字段为联系人手机
    @Mobile(message = "收件人手机格式不正确")
    private String receiverMobile;


    // ========== 交易过程中间 ==========
    private MemberConfMaterialDTO metalConf;
}
